import { RouteRecordRaw } from 'vue-router';
import { Layout } from '@/router/constant';
import { PeopleOutline, ShieldOutline } from '@vicons/ionicons5';
import { renderIcon } from '@/utils/index';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/role',
    name: 'Role',
    redirect: '/role/management',
    component: Layout,
    meta: {
      title: '角色管理',
      icon: renderIcon(PeopleOutline),
      sort: 2,
      permissions: ['role:view'], // 添加权限控制
    },
    children: [
      {
        path: 'management',
        name: 'role_management',
        meta: {
          title: '角色管理',
          permissions: ['role:view'], // 添加权限控制
        },
        component: () => import('@/views/system/role/role.vue'),
      },
      // {
      //   path: 'permission',
      //   name: 'role_permission',
      //   meta: {
      //     title: '权限管理',
      //     icon: renderIcon(ShieldOutline),
      //     permissions: ['permission:view'], // 添加权限控制
      //   },
      //   component: () => import('@/views/system/role/permission.vue'),
      // },
    ],
  },
];

export default routes;
